def validate_credit_card(card_number: str) -> bool:
    """Валидируем номер карты"""

    card_number = "".join(c for c in card_number if c.isdigit())

    if not 13 <= len(card_number) <= 19:
        return False

    reversed_digits = [int(digit) for digit in reversed(card_number)]
    doubled_digits = [
        digit * 2 if i % 2 == 1 else digit for i, digit in enumerate(reversed_digits)
    ]
    subtracted_digits = [digit - 9 if digit > 9 else digit for digit in doubled_digits]
    total_sum = sum(subtracted_digits)

    is_valid = total_sum % 10 == 0

    return is_valid


if __name__ == "__main__":
    print(validate_credit_card("4236606034002222"))
